import QtQuick 1.1
import com.nokia.symbian 1.1

Page {
    id: mainPage

    ListModel {
        id: mainModel
        ListElement {
            name: "Dialogs"
            componentsCount: 2
            demoPage: "DialogsPage.qml"
        }
    }

    Component {
        id: mainDelegateComponent

        ListItem {
            id: listItem
            Column {
                anchors.fill: listItem.padding
                ListItemText {
                    id: titleText
                    mode: listItem.mode
                    role: "Title"
                    text: name
                }
                ListItemText {
                    id: subtitleText
                    mode: listItem.mode
                    role: "SubTitle"
                    text: "Components count: " + componentsCount
                }
            }

            onClicked: pageStack.push( Qt.resolvedUrl( demoPage ) )
        }
    }

    Label {
        id: lb
        anchors.top:   parent.top
        anchors.left:  parent.left
        anchors.right: parent.right

        text: "Select type of components"
    }

    ListView {
        anchors {
            top:    lb.bottom
            topMargin: 20
            left:   parent.left
            right:  parent.right
            bottom: parent.bottom
        }
        clip: true

        model: mainModel
        delegate: mainDelegateComponent
    }
}
